package org.zn.plus.mybatis.sql.builder.model;

import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.zn.plus.mybatis.sql.builder.constant.ColumnType;


public class WhereColumn  implements Fragment,Paramterable{
		
	private String name;
	private String alias=StringUtils.EMPTY;
	private QueryFunction function;
	private String opertion;
	
	private String relation;
	
	private String type=ColumnType.COL;
	
	private Object paramter;
	
	//处理括号包裹
	private List<WhereColumn>  pack;
	
	private QueryTable subQuery;
	
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getAlias() {
		return alias.equals(StringUtils.EMPTY)?name:alias;
	}
	public void setAlias(String alias) {
		this.alias = alias;
	}
	
	public QueryFunction getFunction() {
		return function;
	}
	public void setFunction(QueryFunction function) {
		this.function = function;
	}
	public String getOpertion() {
		return opertion;
	}
	public void setOpertion(String opertion) {
		this.opertion = opertion;
	}
	public String getRelation() {
		return relation;
	}
	public void setRelation(String relation) {
		this.relation = relation;
	}
	public List<WhereColumn> getPack() {
		return pack;
	}
	public void setPack(List<WhereColumn> pack) {
		this.pack = pack;
	}
	public QueryTable getSubQuery() {
		return subQuery;
	}
	public void setSubQuery(QueryTable subQuery) {
		this.subQuery = subQuery;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	

	@Override
	public Fragment self() {
		// TODO Auto-generated method stub
		return this;
	}
	
	
	public Object getParamter() {
		return paramter;
	}
	public void setParamter(Object paramter) {
		this.paramter = paramter;
	}
	
	

	
}
